using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableEquipSkillDao:DaoBase<TableEquipSkill>
    {
        public override void AddPrimaryIndex(TableEquipSkill model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableEquipSkill.txt";
        }

        protected override TableEquipSkill ParseRowData(string[] rowData)
        {
            TableEquipSkill data = new TableEquipSkill();
			data.id = rowData [0];
			data.equipId = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.refineLevel = 0;
            }
            else
            {
                data.refineLevel = int.Parse(rowData[2]);
            }
			data.name = rowData [3];
			data.describe = rowData [4];
			data.buffId = rowData [5];
			data.bonus = rowData [6];

            return data;
        }



        public override void AddTwoIndex(TableEquipSkill model)
        {
            string key = GetUnionKey(model.equipId.ToString(),model.refineLevel.ToString());
            if (!cacheTwoIndex.ContainsKey(key))
            {
                cacheTwoIndex[key] = new List<TableEquipSkill>();
            }
            cacheTwoIndex[key].Add(model);
        }


    }

}
